{% extends "base/base.html" %}
{% block content %}

<table class="top" width="670px">
 <tr>
  <td>
   <p class="title">Incident Details</p>
  </td>
 </tr>

 <tr>
  <td>
   <p>This page contains all relevant information on this incident.  Check back here at any time to obtain current information on the status of this incident.</p>
  </td>
 </tr>

 <tr>
  <td>
   <p>Incident Status: 
    <b>
     {% if detail.0.closed %}
     CLOSED ({{detail.0.closed|date:"Y-m-d H:i:s"}})
     {% else %}
     OPEN
     {% endif %}
    </b>
   </p>
  </td>
 </tr>

 <tr>
  <td>
   <p>
    The following services have been impacted by this incident:
    <br>
   {% if services %}
   {% for row in services %}
   <b>- {{row.service_name_id__service_name}}</b>
    <br>
   {% endfor %}
   {% else %}
   <b><font color="red">- NO SERVICES DEFINED</font></b>
   {% endif %}
   </p>
  </td>
 </tr>

 <tr>
  <td height="10"></td>
 </tr>

 <tr>
  <td>
   <table class="standard">
    <tr>
     <th width="165">Time</th>
     <th width="500px">Description</th>
    </tr>
    <tr>
     <td>{{detail.0.date|date:"Y-m-d H:i:s"}}</td>
     <td>{{detail.0.detail}}</td>
    </tr>

    {% if updates %}
     {% for row in updates %}
      <tr>
       <td>{{row.date|date:"Y-m-d H:i:s"}}</td>
       <td>{{row.detail}}</td>
      </tr>
     {% endfor %}
    {% endif %}
   </table>
  </td>
 </tr> 
 
 <tr>
  <td>*All times are in {{TIME_ZONE}}</td>
 </tr>

 {% if user.is_authenticated %}
 <tr>
  <td height="10"></td>
 </tr>

 <tr>
  <td><a href="/update?id={{id}}">Update Incident</td>
 </tr>
 {% endif %} 

</table>

{% endblock %}
